﻿
using System.Drawing;

namespace Library.Winform.Draw {
  public class EllipseDraw : RectangleDraw {
    public EllipseDraw()
      : this(0, 0, 1, 1) {
    }

    public EllipseDraw(int x, int y, int width, int height)
      : base(x, y, width, height) {
    }

    protected override void DrawMe(Graphics g) {
      var rec = RecWithScrollOffset;



      if (ShadowLen > 0) {
        using (var brush = new SolidBrush(ShadowColor)) {
          g.FillEllipse(brush, rec.X + ShadowLen, rec.Y + ShadowLen, rec.Width, rec.Height);
        }
      }

      using (var brush = new SolidBrush(BackgroundColor)) {
        g.FillEllipse(brush, rec);
      }

      using (var pen = new Pen(PenColor, PenWidth)) {
        g.DrawEllipse(pen, NormalizedRectangle(Rec));
      }

    }
  }
}
